using System;
using cuberga.Workflow;

namespace cuberga.GA.Permutation
{
    public class ExitCondition : ICoreCondition 
    {
        private int _generationNumber;
        public ExitCondition()
        {
            _generationNumber = 0;
        }
        public bool IsTrue()
        {
            // generationNumber = (int)Inbox.Read("GenerationNumber");
            if (_generationNumber > 20) // ToDo by Lum 09-06-2007 - remove Magic number and move parameter to upper level of cfg
            {
                return true;
            }
            else
            {
                _generationNumber++;
                return false;
            }
            
            //throw new NotImplementedException();
        }

        public void Perform()
        {
            throw new NotImplementedException();
        }
    }
}
